import java.util.Scanner;

public class Num {
    int num;//全局变量(实例变量)

    public void setNum() {
        Scanner num = new Scanner(System.in);
        this.num = num.nextInt();
    }
    public int getNum() {
        return this.num;
    }

    public static void main(String[] args) {//这是静态方法

//        Scanner num1 = new Scanner(System.in);
//        Num obj = new Num(); // 创建类实例
//        System.out.print("请输入数字: ");
//        obj.num = num1.nextInt(); // 通过对象赋值给实例变量
//
//        System.out.println("实例变量的值: " + obj.num); // 验证结果
        Num obj = new Num();
        obj.setNum();
        System.out.println(obj.getNum());
    }
}
